package com.uwlaser.service;

import com.uwlaser.base.PageInfo;
import com.uwlaser.base.CommonService;
import com.uwlaser.domain.DeviceMain;
import com.uwlaser.service.dto.DeviceMainDto;
import com.uwlaser.service.dto.DeviceMainQueryParam;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Set;

/**
* @author zk-Qin
* @date 2022-05-11
*/
public interface DeviceMainService extends CommonService<DeviceMain>  {

    static final String CACHE_KEY = "deviceMain";

    /**
    * 查询数据分页
    * @param query 条件
    * @param pageable 分页参数
    * @return PageInfo<DeviceMainDto>
    */
    PageInfo<DeviceMainDto> queryAll(DeviceMainQueryParam query, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param query 条件参数
    * @return List<DeviceMainDto>
    */
    List<DeviceMainDto> queryAll(DeviceMainQueryParam query);

    DeviceMain getById(Integer id);
    DeviceMainDto findById(Integer id);

    /**
     * 插入一条新数据。
     */
    int insert(DeviceMainDto resources);
    int updateById(DeviceMainDto resources);
    int removeById(Integer id);
    int removeByIds(Set<Integer> ids);

    DeviceMainDto insert(MultipartFile file, DeviceMainDto deviceMainDto);

    DeviceMainDto updateById(MultipartFile file, DeviceMainDto deviceMainDto);

    /**
     * 获取监控列表
     * @param query
     * @param pageable
     * @return
     */
    PageInfo<DeviceMainDto>monitor(DeviceMainQueryParam query, Pageable pageable);

    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    // void download(List<DeviceMainDto> all, HttpServletResponse response) throws IOException;
}
